package com.yvon.maple.service.msg.core.handler.handler;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author : Yvon
 * @since : 2021-12-23
 */
@Component
public class HandlerHolder {

    private Map<Integer, Handler> handlerMap = new HashMap<>(32);

    public void putHandler(Integer channelCode, Handler handler) {
        handlerMap.put(channelCode, handler);
    }

    public Handler getHandler(Integer channelCode) {
        return handlerMap.get(channelCode);
    }
}
